    

<cfset listEvent = viewstate.getValue("myself") & viewstate.getValue("xe.list")  />
<cfset eventDateTimeRecord = viewstate.getValue("eventDateTimeRecord") />
<cfset keyString = "&eventDateTimeId=#urlEncodedFormat(eventDateTimeRecord.geteventDateTimeId())#" />
<cfset commitEvent = viewstate.getValue("myself") & viewstate.getValue("xe.commit") & keyString />
<cfset validation = viewstate.getValue("eventDateTimeValidation", structNew()) />

<cfset isNew = true />
		

		<cfif (not isNumeric(eventDateTimeRecord.geteventDateTimeId()) and len(eventDateTimeRecord.geteventDateTimeId())) or (isNumeric(eventDateTimeRecord.geteventDateTimeId()) and eventDateTimeRecord.geteventDateTimeId())>
			<cfset isNew = false />
		</cfif>
	
		
<cfoutput>
<div id="breadcrumb">
		<a href="#listEvent#">Event Date Times</a> / 
		<cfif isNew>
			Add New Event Date Time
		<cfelse>
			#eventDateTimeRecord.geteventDateTimeId()#
		</cfif>
</div>
</cfoutput>
<br />


								
<cfform action="#commitEvent#" class="edit">
    
<fieldset>
    

    <cfoutput>
    <input type="hidden" name="eventDateTimeId" value="#eventDateTimeRecord.geteventDateTimeId()#" />
    </cfoutput>
  
        <div class="formfield">
	        <label for="eventId" <cfif structKeyExists(validation, "event")>class="error"</cfif>><b>Event:</b>
	        </label>
	        <cfset valueQuery = viewstate.getValue("eventList") />
	        <div>
        
          <select name="eventId" id="eventId" >
            
            <cfoutput query="valueQuery">
              <option value="#valueQuery.eventID#" <cfif eventDateTimeRecord.geteventId() eq valueQuery.eventID>selected</cfif>>#valueQuery.eventID#</option>
            </cfoutput>
          </select>
	        </div>
	        <cfmodule template="/ModelGlue/customtags/validationErrors.cfm" property="event" validation="#validation#" />
        </div>
      
        <div class="formfield">
	        <label for="startDateTime" <cfif structKeyExists(validation, "startDateTime")>class="error"</cfif>><b>Start Date Time:</b></label>
	        <div>
	        
		        <cfinput 
									type="text" 
									class="input" 
									 
									id="startDateTime" 
									name="startDateTime" 
									
										value="#dateFormat(eventDateTimeRecord.getstartDateTime(), "m/d/yyyy")# #timeFormat(eventDateTimeRecord.getstartDateTime(), "h:mm TT")#" 
									
						/>
		      
	        </div>
	        <cfmodule template="/ModelGlue/customtags/validationErrors.cfm" property="startDateTime" validation="#validation#" />
        </div>
    
        <div class="formfield">
	        <label for="endDateTime" <cfif structKeyExists(validation, "endDateTime")>class="error"</cfif>><b>End Date Time:</b></label>
	        <div>
	        
		        <cfinput 
									type="text" 
									class="input" 
									 
									id="endDateTime" 
									name="endDateTime" 
									
										value="#dateFormat(eventDateTimeRecord.getendDateTime(), "m/d/yyyy")# #timeFormat(eventDateTimeRecord.getendDateTime(), "h:mm TT")#" 
									
						/>
		      
	        </div>
	        <cfmodule template="/ModelGlue/customtags/validationErrors.cfm" property="endDateTime" validation="#validation#" />
        </div>
    
<cfoutput>
<div class="controls">
 	<input type="submit" value="Save" />
  <input type="button" value="Cancel" onclick="document.location.replace('#listEvent#')" />
</div>
</cfoutput>
</fieldset>
</cfform>
    
	
